from bs4 import BeautifulSoup
from urllib import request
import time

"""
This programs used to download 10 hot top news from url"http://top.baidu.com/"
"""
URL = "http://top.baidu.com/"
Charset = 'utf-8'
req = request.Request(url=URL)
html = request.urlopen(req).read()
soup = BeautifulSoup(html, 'lxml')
hot_list = soup.find_all('ul', {"class": "list"})
del(soup)
hot_list = BeautifulSoup(str(hot_list),'lxml')
print(hot_list.find_all('a',{"class":'list-title'}))
hot_list = BeautifulSoup(hot_list,'lxml')
for child in hot_list.a:
    print(child)